import request from '@/utils/request'

const api_name = '/admin/product/baseTrademark'

export default {
    delete(id){
        return request.delete(`${api_name}/remove/${id}`)
    },

    addOrUpdate(trademark){
        if(trademark.id){
            return request.put(`${api_name}/update`,trademark)
        }else{
            return request.post(`${api_name}/save`,trademark)
        }
    },

        //admin/product/baseTrademark/{page}/{limit}
     getPageList(page,limit){
         if(page&& limit){
            return request.get(`${api_name}/${page}/${limit}`)
         }else{
            return request.get(`${api_name}/getTrademarkList`)
         }    
     },

     // GET /admin/product/baseTrademark/get/{id}

     get(id){
         return request.get(`${api_name}/get/${id}`)
     },

     // GET /admin/product/baseTrademark/findBaseTrademarkByKeyword/{keyword}
    findBaseTrademarkByKeyword(keyword){
        return request({
            method:"get",
            url:`${api_name}/findBaseTrademarkByKeyword/${keyword}`
        })
    }
}